package com.xtpt.disaster.controller;

import com.xtpt.disaster.bean.*;
import com.xtpt.disaster.common.PortalResult;
import com.xtpt.disaster.common.ShenTong.ShenTongCmdBuilder;
import com.xtpt.disaster.utils.*;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@CrossOrigin
//@ComponentScan("com.example.spring")
@RestController
@RequestMapping("/rest/shentong/")
@Api(tags = "神通数据库备份删除")
public class ST_DBActionController {

    @Autowired
    BackupRestoreUtil<ShenTongCmdBuilder> backupRestoreUtil;
    
    @Autowired
    ShenTongCmdBuilder shenTongCmdBuilder;

    @RequestMapping("/backup")
    public PortalResult backup(@RequestBody ParametersDBBackup backupInfo)
    {
        return backupRestoreUtil.backup(backupInfo,shenTongCmdBuilder);
    }
    @RequestMapping("/recover")
    public PortalResult recover(@RequestBody ParametersDBRecover recoverInfo)
    {
        return backupRestoreUtil.recover(recoverInfo,shenTongCmdBuilder);
    }
}
